{extend name="public:base"}
{block name='css'}
{/block}

{block name='body'}
<div class="view view-main white-navbar white-toolbar">
    <div data-name="home" class="page">

        <div class="navbar">
            <div class="navbar-inner">
                <div class="left"><a href="{$my_prev_url|default='/'}" class="external"><i class="iconfont icon-fanhui"></i></a></div>
                <div class="center"><span>支付</span></div>
            </div>
        </div>

        <div class="page-content">

            <div class="list me-info no-border" style="margin:15px 0px;">
                <ul>
                    <li>
                        <div class="item-content">
                            <div class="item-media img-a1"><img src="{$info.img}" /></div>
                            <div class="item-inner">
                                <div class="item-title">
                                    <span>{$info.title}</span>
                                    <div class="item-footer">热度：{$info.hot|default=0}</div>
                                </div>
                            </div>
                        </div>
                    </li>
                </ul>
            </div>

            <div class="pay-money">
                <p class="p1">付款金额</p>
                <p class="p2">￥{:input('amount', '0.00', 'trim')}</p>
            </div>
            <form id="form">
                <input type="hidden" name="business_user_id" value="{:input('business_user_id')}"/>
                <input type="hidden" name="amount" value="{:input('amount')}"/>
            </form>

            <div class="block">
                <p class="row segmented-round">
                    <a class="col button button-big button-fill external" href="javascript:;" onclick="ajaxSubmit();" style="background:#66ba61;">确认支付</a>
                </p>
            </div>

        </div>


    </div>
</div>
{/block}

{block name="js"}
<script>
    var ajaxOn = false;
    function ajaxSubmit() {
        if (ajaxOn) {
            return false;
        }
        ajaxOn = true;
        $.post("", $('#form').serialize(), function(data){
            messageToast(data.info);
            if (data.status == 'y') {
                setTimeout(function(){
                    self.location = "{:url('index')}";
                },1000)
            }
        }, 'json');
    }
</script>
{/block}